<template>
<div>
    <router-view></router-view>

    <div style="margin-top: 40px" v-show="$route.meta.istrun">
      <t-tab-bar v-model="value" theme="tag" :split="false">
        <t-tab-bar-item v-for="item in list" :key="item.value" :value="item.value" @click="tz(item.path)">
          {{ item.label }}
          <template #icon>
            <t-icon :name="item.icon" />
          </template>
        </t-tab-bar-item>
      </t-tab-bar>
    </div>
</div>
</template>

<script setup>
import {onMounted, ref} from 'vue'
import {useRouter} from "vue-router";
const router=useRouter()
const value = ref('label_1');
const list = ref([
  { value: 'label_1', label: '首页', icon: 'home',path:'/main' },
  { value: 'label_2', label: '测试', icon: 'app' ,path:'/exam'},
  { value: 'label_3', label: '测试题', icon: 'chat' ,path:'/question'},
  { value: 'label_4', label: '我的', icon: 'user' ,path:'/my'},
]);

onMounted(()=>{
  router.push("/main")
})
const tz=(path)=>{
  router.push(path)
}

</script>

<style scoped>

</style>